Fixes for test certificate download and handling #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've had some initial problems getting the test setup running due to triggering the CAPTCHA testing on the BankID end causing
the FPTestcert4_20220818.p12 downloaded by create_bankid_test_server_cert_and_key to contain the CAPTCHA test
instead.
This caused the openssl execution in split_certificate to silently fail, resulting in zero length certificate and key.
Added a bit of error handling to detect and raise an exception in split_certficate for subprocess errors, also added the
possibility to point the environment variable TEST_CERT_FILE to an existing p12 certificate file which will be used instead
of fetching the certificate (which got me out of the snag by letting me download the file from my browser instead).